<h1>Hey <%= h(@runner.first_name) %> <%= h(@runner.last_name) %>!</h1>
<div style="padding-top: 12px; height: 520px;width:540px;float:left">
<%= startmapsetup %>
<%= showroute(@runner.current_route) %>

<%= preprunners(@runner) { #(need to escape in ruby and javascript)
	'You\\\'ve run '+ @runner.distance_along_route.to_s + ' out of 26.2 miles!' } %>

<%= prepinc(@incentive) do |i|
i.reward.to_s() +' in only ' + (i.goal-@runner.distance_cache).to_s() +' miles!' + '<br/>' + image_for(i).to_s()
end if(@incentive) %>

loadmarks(marks,points,runnermarkers,incmarkers);
addmarkers(runnermarkers,map);
addmarkers(incmarkers,map);

<% if @incentive %>
GEvent.trigger(incmarkers[0],'click');
<% end %>

<% if defined? @landmarks and not @landmarks.nil? %>
//landmarks
<%= showlandmarks(@landmarks,true) {|l| landmarkdesc(l) } %>
<% end %>

<%= endroute %>
<%= endmapsetup %>
<div id="map_canvas" style="width: 540px; height: 500px">A modern web <a href="http://www.alternativebrowseralliance.com/browsers.html">browser</a> with Javascript enabled is required for this site.</div>
</div>

<% unless(@incentive) %>
<div id="congratsbox">
	<b>Congratulations!</b><br/>You have all the rewards!<br/>Keep up the good work!<br/><br/>
</div>
<% end %>
<% if(@previnc) %>
<div id="incbox">
	<p style="font-size:1.2em;color:blue">Rewards you've earned:</p>
	<ul style="list-style-type:disc">
	<% @previnc.each do |i| %>
		<li><%= h(i.reward) %><br/><%=image_for(i,:medium)%></li>
	<% end %>
	</ul>
</div>
<% end %>
<div id="legend">
	<table>
		<tr>
			<td>You</td>
			<td>Start</td>
			<td>End</td>
			<% if @incentive %><td>Rewards</td><% end %>
<% if defined? @landmarks and not @landmarks.nil? %>
			<td>Landmarks</td>
<% end %>
		</tr>
		<tr>
			<td><%= image_tag '/images/cr_runner.png'%></td>
			<td><%= image_tag '/images/start.png'%></td>
			<td><%= image_tag '/images/finish.png'%></td>
			<% if @incentive %><td><%= image_tag '/images/cr_star.png' %></td><% end %>
<% if @landmarks %>
			<td><%= image_tag '/images/landmark.png' %></td>
<% end %>
		</tr>
	</table>
</div>
